package com.jfshop.framework.util;

import java.util.TimeZone;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;


/**
 * 
 * Name: TimeZoneUtil.java
 * ProjectName: [Framework-Base]
 * Package: [com.grandthink.framework.util.TimeZoneUtil.java]
 * Description: 时区处理工具类  
 * 
 * @since JDK1.6
 * @see
 * @version [v1.0]
 *
 * Author: @author: Thunder, Daemon
 * Date: 2013年12月5日 上午9:43:16
 *
 * Update-User: @author
 * Update-Time:
 * Update-Remark:
 * 
 * Check-User:
 * Check-Time:
 * Check-Remark:
 * 
 * Company: GrandThink
 * Copyright: GrandThink
 */
public final class TimeZoneUtil {

	public final static String LAGUAGE_IN_SESSION = "lauguage"; 
	public final static TimeZone DEFUAL_TIMEZONE = TimeZone.getTimeZone("Asia/Shanghai");
	
	/**
	 * @throws RuntimeException
	 */
	private TimeZoneUtil() throws RuntimeException {
		
		throw new RuntimeException("util class is static");
	}
	
	/**
	 * 
	 * 得到用户的时区，优先顺序：
	 *   1.根据session得到timezone
	 *   2.根据req的ip得到timezone
	 *   3.默认的timezone
	 *   
	 * @return 时区
	 */
	public static TimeZone getTimeZone() {
		
		/* 
		 * 1.根据session得到timezone
		 * 2.根据ip得到timezone
		 * 3.默认的timezone
		 * 
		 *  */
		
		return DEFUAL_TIMEZONE;
	}
	
	/**
	 * 
	 * 得到用户的时区，优先顺序：
	 *   1.根据session得到timezone
	 *   2.根据req的ip得到timezone
	 *   3.默认的timezone
	 * 
	 * @param req 用户请求
	 * @param session 用户session
	 * @return 时区
	 */
	public static TimeZone getTimeZone( HttpServletRequest req, HttpSession session ) {
		
		
		/* 
		 * 1.根据session得到timezone
		 * 2.根据ip得到timezone
		 * 3.默认的timezone
		 * 
		 *  */
		
		return DEFUAL_TIMEZONE;
	}
}
